Fix for version converter not applying applicable conversion#2941
Fix for version converter not applying applicable conversion#2941LinusJungemann wants to merge 1 commit into
Conversation
|
@microsoft-github-policy-service agree company="Paderborn Center for Parallel Computing" |
|
I don't think this is the right fix, as from target version we have just the same information. Each function corresponds to one opset pair. The core issue here is the model supplied is opset 17, which is not supported by this converter. We can add support for that. |
|
This is might be part of the problem, but I think the underlying problem is still how the converters are selected independent of opset version: node_version will not be set to 7, because node_version will be set to self._default_onnx_opset, because node.version is not set for a default onnx model.self._default_onnx_opset is set bywhich in turn is set to the model version: If we now have our conversion function registered like this In my opinion, the easiest way to achieve this behavior is not to look at the source version, but the target version. Then we get for an up_conversion registered for opset 22 automatically support for all model source opsets from 7-21 (or 18-21 if the old opset bound for the converter is kept). I tested the change by implementing an version converter for ReduceLogSumExp in onnx-passes: iksnagreb/onnx-passes#4 An alternative approach would probably be to register the nodes not based on operator version, but based on the last model opset, which they support before an upgrade. So for the example Acos Op, this would then be |
|
Thanks for your analysis! Will take a closer look tomorrow |
This PR fixes #2938.
Done by changing the way in which the registration of converter functions works.
The version in the decorator represents the target version now.
Because there can only ever be one converter function with same target version and direction combincation, this lookup is unique and will correctly lookup the conversion from the last supported op version, even if multiple model versions are skipped between op versions.